home *** CD-ROM | disk | FTP | other *** search
- REWS - an ascii to w* (more-or-less) format converter Ver. 1.2
-
- Copyright 1986 by H. E. Schaffer Permission is granted for
- non-commercial copying and distribution.
-
- The primary aim of this program is to ease the use of ascii files
- in the normal W* D(ocument) file mode. It converts certain carriage
- returns to soft carriage returns, and optionally converts some
- spaces to soft spaces. This allows w* to reformat such text. A
- carriage return at the end of a non-empty line is changed to a soft
- carriage return if it is followed by a non-empty line with a non-space
- character in col. 1. The last of a series of spaces is left as a hard
- space with earlier ones optionally (if the -s option is given, and if
- the series does not begin a line ) converted to soft spaces (except
- for the first space after a period.) This greatly eases working with
- right justified text. The soft spacing option is not needed if the
- file is not right justified, and may not be desireable if there are
- formulas and tables embedded in the text.
-
- A blank line will have a hard carriage return. A line followed by
- either a blank line or an indented line will also have a hard carriage
- return. The end character of each word is also tinkered with to get
- into a format more suitable for W*. Embedded tabs are left alone, and
- are not fully understood by W*. If you have trouble with right
- justification you may have embedded tabs - they can be found since the
- cursor will jump over several (apparent) spaces when moved one column.
- Delete the tab, and reformat.
-
- Operation
-
- rews [-s] in_file_ascii out_file_ws
-
- The optional -s option causes the conversion to soft spacing. The
- input file is an ascii file. The output file is the input file
- converted to a w* type format.
-
- Technical Discussion
-
- The conversion is done by a state machine with 3 major states. The
- state depends on the previous character read - which can be a newline,
- a space, or a "character" (i.e., anything else.) Spaces are
- treated as characters unless the -s option is specified. The flag
- "initial" identifies the beginning of a line. This flag plus the
- contents of a 3 character wide moving window drive all the decisions.
- A character followed by white space is converted by setting its 8'th
- bit.
-
-
- Disclaimer
-
- The quality of the conversion done by this program is limited by
- my degree of understanding of the details of the W* format. No
- warranty of perfection or suitability is made. Send suggestions and
- comments to me a Box 7109, N.C. State Univ., Raleigh, NC 27695.